﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace cpe.cpein.SERVER
{
    [ServiceContract]
    public interface IGroupsService
    {
        [OperationContract]
        List<Group> GetAllGroups(bool serachInDeleted, User current);

        [OperationContract]
        List<GroupType> GetAllGroupTypes(User current);

        [OperationContract]
        Group GetGroupByID(int id, User current);

        [OperationContract]
        Group AddGroup(Group user, User current);

        [OperationContract]
        bool RemoveGroup(Group user, User current);

        [OperationContract]
        Group UpdateGroup(Group user, User current);
    }

    // The GroupType object as WS's client view it.
    [DataContract]
    [Serializable]
    public class GroupType
    {
        [DataMember]
        public int Id { get; set; }
        [DataMember]
        public string Label { get; set; }
        [DataMember]
        public bool IsDeleted { get; set; }
    }

    [DataContract]
    [Serializable]
    public class Group
    {
        [DataMember]
        public int Id { get; set; }
        [DataMember]
        public string Label { get; set; }
        [DataMember]
        public int IDType { get; set; }
        [DataMember]
        public GroupType Type { get; set; }
        [DataMember]
        public bool IsWorkable { get; set; }
        [DataMember]
        public bool IsDeleted { get; set; }
        [DataMember]
        public String Description { get; set; }
    }
}
